gtk-demo: Make icon counter work from ui file
authorBenjamin Otte <otte@redhat.com>
Sat, 7 Jan 2017 01:05:26 +0000 (02:05 +0100)
committerBenjamin Otte <otte@redhat.com>
Sat, 7 Jan 2017 01:09:40 +0000 (02:09 +0100)
Gets rid of update always being 1 frame late.

demos/gtk-demo/fishbowl.c
demos/gtk-demo/fishbowl.ui

index 40c5e2a6924e0aa52e2dffaccce77721dac99d86..db49822fc5405f64282a612939a1fc27538a58e8 100644 (file)
@@ -70,8 +70,7 @@ do_stats (GtkWidget *widget,
           n_frames += stats->frame_counter[i];
         }
       
-      new_label = g_strdup_printf ("%u icons - %.1f fps",
-                                   stats->item_counter[stats->stats_index],
+      new_label = g_strdup_printf ("icons - %.1f fps",
                                    (double) G_USEC_PER_SEC * n_frames
                                        / (N_STATS * STATS_UPDATE_TIME));
       gtk_label_set_label (GTK_LABEL (info_label), new_label);
index b8cab8824b5593899753b44329fe8e4558088a28..538f9ba68af9911016d9de68dbce93ea51479b07 100644 (file)
         <child>
           <object class="GtkLabel" id="info_label">
             <property name="visible">True</property>
-            <property name="label">0 icons - 0 fps</property>
+            <property name="label">icons - 0 fps</property>
+          </object>
+          <packing>
+            <property name="pack_type">end</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel">
+            <property name="visible">True</property>
+            <property name="label" bind-source="bowl" bind-property="count">0</property>
           </object>
           <packing>
             <property name="pack_type">end</property>